home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LiquidLibrary 2005 September
/
LiquidLibrary 2005 Sep - Disc 1.iso
/
pc
/
Portfolio Browser
/
Filters
/
PDF
/
LIB
/
gs_epsf.ps
< prev
next >
Wrap
Text File
|
2003-01-03
|
2KB
|
50 lines
% Copyright (C) 1989, 1996 Aladdin Enterprises. All rights reserved.
%
% This software is licensed to a single customer by Artifex Software Inc.
% under the terms of a specific OEM agreement.
% $RCSfile$ $Revision$
% Allow the interpreter to recognize MS-DOS EPSF file headers, and skip to
% the PostScript section of the file.
/.runnoepsf /run load def
/.epsfheader <C5D0D3C6> def
/run
{ dup type /filetype ne { (r) file } if
% Check for MS-DOS EPSF file (see Red Book p. 729).
true exch 0 1 3
{ % Stack: true file index
1 index read dup { pop dup .epsfheader 3 index get eq } if
{ pop pop } % if matched, don't need the character
{ % unread characters (wasn't EPSF)
2 index exch unread % unread mismatch character
dup { % loop unreading backwards in .epsfheader
1 sub dup .epsfheader exch get 2 index exch unread
} repeat pop
exch not exch exit % change true to false
}
ifelse
}
for exch % Stack: file true/false
{ % This block is executed if the file is MS-DOS EPSF.
% Build up the little-endian byte offset and length.
2
{ 1 0 4
{ 2 index read not { pop exit } if % if EOF, let error happen
2 index mul add exch 256 mul exch
}
repeat exch pop exch
}
repeat
% Stack: offset length file
% Use flushfile to skip quickly to the start of the
% PostScript section.
dup 4 -1 roll 12 sub () /SubFileDecode filter flushfile
% Now interpret the PostScript.
exch () /SubFileDecode filter cvx .runexec
}
{ .runnoepsf
}
ifelse
} odef